package com.oss.validator.wxUser;

import com.jfinal.core.Controller;
import com.jfinal.render.JsonRender;
import com.jfinal.validate.Validator;
import com.oss.utils.constants.DataDictionary;

public class userRegist extends Validator {

    @Override
    protected void validate(Controller c) {
        validateRequired("name", "msg", "请填写姓名");
        validateRequired("mobile", "msg", "请填写手机号码");
        validateRequired("province", "msg", "请选择省份");
        validateRequired("city", "msg", "请选择市");
//        validateRequired("region", "msg", "请选择区");
        validateRequired("dealerId", "msg", "请选择门店");
    }

    @Override
    protected void handleError(Controller c) {
        c.setAttr("code", DataDictionary.FAILURE);
        c.render(new JsonRender().forIE());
    }

}
